<?php
declare (strict_types = 1);

namespace app\course\service\live;

use think\facade\Request;
use app\common\service\BaseService;
use app\course\logic\live\LiveAgora as AgoraLiveLogic;

/**
 * 声网直播接口类-前台
 */
class LiveAgora extends BaseService
{

    /**
     * 获取声网配置
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-10-27
     */
    public function getAgoraConfig()
    {
        $config = app(AgoraLiveLogic::class)->getAgoraConfig();

        return $this->parseToData($config, 1, '获取成功');
    }

    /**
     * 获取声网bb配置
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-10-27
     */
    public function getNetlessConfig()
    {
        $config = app(AgoraLiveLogic::class)->getNetlessConfig();

        return $this->parseToData($config, 1, '获取成功');
    }

    /**
     * 创建声网教室
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-10-27
     */
    public function createRoom()
    {
        $data = app(AgoraLiveLogic::class)->createRoom();

        return $this->parseToData($data, 1, '创建成功');
    }

    /**
     * 获取房间配置
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                             [description]
     */
    public function getRoomConfig()
    {
        $data = app(AgoraLiveLogic::class)->getRoomConfig();

        return $this->parseToData($data, 1, '查询成功');
    }

    /**
     * 获取房间用户信息
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                             [description]
     */
    public function roomInfo()
    {
        $data = app(AgoraLiveLogic::class)->roomInfo();

        return $this->parseToData($data, 1, '查询成功');
    }

    /**
     * 更新房间配置
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                             [description]
     */
    public function setRoomConfig()
    {
        $data = app(AgoraLiveLogic::class)->setRoomConfig();

        return $this->parseToData($data, 1, '更新成功');
    }

    /**
     * 进入声网教室
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-10-29
     */
    public function entryRoom()
    {
        $data = app(AgoraLiveLogic::class)->entryRoom();

        return $this->parseToData($data, 1, '进入成功');
    }

    /**
     * 获取房间用户列表
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-10-29
     */
    public function roomUsers()
    {
        $data = app(AgoraLiveLogic::class)->roomUsers();

        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 更新用户文字聊天禁用状态
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                      [description]
     */
    public function setUserChatState()
    {
        $data = app(AgoraLiveLogic::class)->setUserChatState();

        return $this->parseToData($data, 1, '更新成功');
    }

    /**
     * 发送点对点聊天消息
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                      [description]
     */
    public function sendPeerChat()
    {
        $data = app(AgoraLiveLogic::class)->sendPeerChat();

        return $this->parseToData($data, 1, '发送成功');
    }

    /**
     * 获取指定房间内的所有用户和流列表
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                      [description]
     */
    public function getUserStreams()
    {
        $data = app(AgoraLiveLogic::class)->getUserStreams();

        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 设置用户属性
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-03
     * @return [type]                      [description]
     */
    public function setUserProperties()
    {
        $data = app(AgoraLiveLogic::class)->setUserProperties();

        return $this->parseToData($data, 1, '设置成功');
    }

    /**
     * 踢出用户
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-04
     * @return [type]                      [description]
     */
    public function kickUser()
    {
        $data = app(AgoraLiveLogic::class)->kickUser();

        return $this->parseToData($data, 1, '踢出成功');
    }

    /**
     * 获取信息通知列表
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-03
     * @return [type]                      [description]
     */
    public function getSequences()
    {
        $data = app(AgoraLiveLogic::class)->getSequences();

        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 更新房间状态
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-03
     * @return [type]                      [description]
     */
    public function setRoomStates()
    {
        $data = app(AgoraLiveLogic::class)->setRoomStates();

        return $this->parseToData($data, 1, '设置成功');
    }

    /**
     * 获取指定房间内的所有流列表
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                      [description]
     */
    public function getStreams()
    {
        $data = app(AgoraLiveLogic::class)->getStreams();

        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 创建流
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date：   2020-11-02
     * @return [type]                      [description]
     */
    public function createStreams()
    {
        $data = app(AgoraLiveLogic::class)->createStreams();

        return $this->parseToData($data, 1, '创建成功');
    }

}
